<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="/WEB-INF/tld/orderStatus.tld" prefix="os" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld//unicode_zh_code.tld" prefix="uc" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<html><head>
<%@ include file="../common.jsp" %>
<script type="text/javascript" src="js/artDialog/artDialog.js?skin=idialog"></script>
<script type="text/javascript" src="js/artDialog/plugins/iframeTools.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/planeButton.js"></script>
<script type="text/javascript" src="<%=basePath %>js/datePicker/WdatePicker.js" defer="defer"></script>
</head><body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="images/content-bg.gif"><div class="titlebt">详细信息</div></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><br/>
<table class="mytable" cellpadding="0" cellspacing="0">
	<th colspan="3">订单信息</th>
	<tr>
		<td class="left"><label>订单号：</label>${vo.parentOrders[0].systemSn}</td>
		<td><label>用户编号:</label>${vo.parentOrders[0].memberNum}</td>
		<td><label>航程类型：</label>
		<s:if test="vo.parentOrders[0].voyagetype==1">单程</s:if>
			<s:elseif test="vo.parentOrders[0].voyagetype==2">往返</s:elseif>
		</td>
	</tr>
	<tr>
		<td class="left"><label>预订时间：</label><s:date name="vo.parentOrders[0].bookTime" format="yyyy年MM月dd日 HH:mm:ss"/></td>
		<td colspan="3"><label>订单状态：</label><os:parentOrder orderstatus="${vo.parentOrders[0].status}"/>
			<c:if test="${vo.parentOrders[0].status==1}">
			 <button class="Submit" onclick="applyRefund('${vo.parentOrders[0].id}')">申请退款</button></c:if>
	<!--	<c:if test="${vo.parentOrders[0].status==-1}">&nbsp;
    		<button class="Submit">支付核对</button>
    	</c:if>-->
		</td>
	</tr>
	<tr>
		<td class="left"><label>支付时间：<s:date name="vo.parentOrders[0].payTime" format="yyyy年MM月dd日 HH:mm:ss"/></label></td>
		<td colspan="3"><label>订单总额：</label><fmt:formatNumber value="${vo.parentOrders[0].orderTotal}" pattern="￥0.00"></fmt:formatNumber>
		</td>
	</tr>
	<tr>
		<td class="left"><label>退款时间：</label><s:date name="vo.parentOrders[0].refundTime" format="yyyy年MM月dd日 HH:mm:ss"/>&nbsp;</td>
		<td colspan="3"><label>累计退款次数：</label>
		${vo.parentOrders[0].refundNum} 次</td>
	</tr>
	<tr>
		<td class="left" colspan="4">
			<s:if test="vo.parentOrders[0].lock==0">
				<button class="Submit" onclick="orderLock('${vo.parentOrders[0].id}',1,location.href);">锁定处理</button>
			</s:if>
			<s:else>
				<s:if test="vo.parentOrders[0].lockUser==#session.login_user">
					<button class="Submit"  onclick="orderLock('${vo.parentOrders[0].id}',0,location.href);">解除锁定</button>
					&nbsp;<font style="color: red;">订单正在被【${vo.parentOrders[0].lockUser}】锁定处理中……</font>
				</s:if>
				<s:else>
					<font style="color: red;">订单正在被【${vo.parentOrders[0].lockUser}】锁定处理中……</font>
				</s:else>
			</s:else>
		</td>
	</tr>
</table>
<br/>
<!-- 航程信息 -->
<table class="mytable" cellpadding="0" cellspacing="0">
<th colspan="10">航程信息</th>
  <tr style="font-size: 14px; font-weight: bolder">
    <td class="left">&nbsp;</td>
    <td>航班日期</td>
    <td>出发城市</td>
    <td>目的城市</td>
    <td>航班号</td>
    <td>舱位</td>
    <td>票面价</td>
    <td>机建费</td>
    <td>航空公司</td>
    <td>状态</td>
  </tr>
<s:iterator value="vo.childrenOrders" var="order">
  <tr>
    <td class="left" rowspan="3">
    	<s:if test="#order.traltype==1">去程</s:if>
    	<s:elseif test="#order.traltype==2">返程</s:elseif>
    </td>
    <td><s:date name="sdate" format="yyyy年MM月dd日"/></td>
    <td><uc:code codeType="city" code="${order.scityCode}"/>(${order.scityCode})&nbsp;[<s:date name="depTime" format="HH:mm"/>]<br/><uc:code codeType="flight" code="${order.scityCode}"/></td>
    <td><uc:code codeType="city" code="${order.ecityCode}"/>(${order.ecityCode})&nbsp;[<s:date name="arrTime" format="HH:mm"/>]<br/><uc:code codeType="flight" code="${order.ecityCode}"/></td>
    <td>${order.flightNo}</td><td>${order.cabinCode}</td>
    <td><fmt:formatNumber value="${order.fare}" pattern="￥0.00"></fmt:formatNumber></td>
    <td><fmt:formatNumber value="${order.tax}" pattern="￥0.00"></fmt:formatNumber></td>
	<td>${order.aircom}</td>
    <td>
    <os:apiJrOrder status="${order.orderStatus!=null?order.orderStatus:'-99'}" />
   </td>
  </tr>
  <tr>
  	<td>平台订单：${order.terraceSn}</td>
  	<td>PNR编码：${order.pnrno}</td>
  	<td colspan="7" ><label style="color: red"><b>政策描述</b>：${order.policyDesc!=null?order.policyDesc:'暂无'}</label></td>
  </tr>
  <tr>
  <td colspan="10" align="center">
  	操作：
  	<c:choose>
  		<c:when test="${vo.parentOrders[0].status==-1 || vo.parentOrders[0].status==5}">
  			订单已关闭 
  		</c:when>
  		<c:otherwise>
	  			<c:choose>
	  				<c:when test="${vo.parentOrders[0].lock==true && login_user!=vo.parentOrders[0].lockUser}">
	  					<label style="color:red">订单正在处理中……</label>
	  				</c:when>
	  				<c:otherwise>
	  				<c:choose>
	  					<c:when test="${vo.parentOrders[0].lock==true && login_user==vo.parentOrders[0].lockUser}">
	  						<c:if test="${vo.parentOrders[0].status>0}">
	  							<c:if test="${order.orderStatus==null}">
									<button class="Submit" type="button" id="create_api" onclick="create_api('${order.id}');return false;"><b>API预订</b></button>
									<button class="Submit" type="button" id="create_api" onclick="ticketManager('${order.id}');return false;"><b>手动订单</b></button>
									<!-- <button class="Submit" type="button"><b>取消订单，申请退款</b></button> -->
								</c:if>
								<c:if test="${order.orderStatus==0}">
									<button class="Submit" type="button" onclick="autopay('${order.id}')"><b>确认付款</b></button>
									<button class="Submit" type="button" id="create_api" onclick="ticketManager('${order.id}');return false;"><b>手动订单</b></button>
									<!--<button class="Submit" type="button"><b>取消订单，申请退款</b></button> -->
								</c:if>
								<c:if test="${order.orderStatus==2}">
									<button class="Submit" type="button" onclick="ticketSms('${order.id}')"><b>发送出票短信</b></button>
									<button class="Submit" type="button" onclick="gaiQian('${order.id}');return false;"><b>办理改签</b></button>
									<button class="Submit" type="button" onclick="riseCabin('${order.id}');return false;"><b>办理升舱</b></button>
									<button class="Submit" type="button" onclick="tuifei('${order.id}');return false;"><b>申请退废</b></button>
								</c:if>
								<c:if test="${order.orderStatus==7}">
									<!-- <button class="Submit"><b>PNR换政策</b></button>
									<button class="Submit"><b>手动改政策</b></button>-->
									<button class="Submit" type="button" id="create_api" onclick="ticketManager('${order.id}');return false;"><b>手动订单</b></button>
								</c:if>
								<c:if test="${order.orderStatus==-9}">
									<button class="Submit" type="button" onclick="changePolicy('${order.id}');return false;"><b>手动换政策</b></button>
									<button class="Submit" type="button" id="create_api" onclick="ticketManager('${order.id}');return false;"><b>手动订单</b></button>
								</c:if>
								<button class="Submit" type="button" onclick="refreshOrder('${order.id}')"><b>刷新订单</b></button>
	  						</c:if>
	  						<c:if test="${vo.parentOrders[0].status==0}">
	  							用户未付款
	  						</c:if>
	  					</c:when>
	  					<c:otherwise>
	  						订单需锁定后进行相关操作
	  					</c:otherwise>
	  				</c:choose>
	  				</c:otherwise>
	  			</c:choose>
  			
  		</c:otherwise>
  	</c:choose>
  </td></tr>
  <c:if test="${order.remarks!=null && order.remarks!=''}">
  	<tr>
  		<td class="left">备注信息：</td>
  		<td style="color: red" colspan="9">${order.remarks}</td>
  	</tr>
  </c:if>
</s:iterator>
</table>
<!-- 航程信息  END-->
<br/>
<!-- 乘客信息-->
<table class="mytable" cellpadding="0" cellspacing="0">
	<c:choose>
		<c:when test="${vo.parentOrders[0].voyagetype==2}"><th colspan="7"></c:when>
		<c:otherwise><th colspan="5"></c:otherwise>
	</c:choose>
	乘客信息</th>
	<tr style="font-size: 14px; font-weight: bolder">
		<td class="left">姓名</td><td>类型</td><td>证件号码</td><td>去程票号</td><td>去程状态</td>
		<c:if test="${vo.parentOrders[0].voyagetype==2}"><td>返程票号</td><td>返程状态</td></c:if>
	</tr>
	<s:iterator value="vo.orderPassengers" id="item">
	<tr>
		<td class="left">${item.passenger}</td>
		<td>${item.psgType==1?"成人":"儿童"}</td>
		<td><s:property value="#item.cardNum"/></td>
		<td>${item.ticketNo!=null?item.ticketNo:'——'}</td>
		<td><os:personState state="${item.state}"/></td>
		<c:if test="${vo.parentOrders[0].voyagetype==2}">
		<td>${item.secTicketNo!=null?item.secTicketNo:'——'}</td>
		<td><os:personState state="${item.secState}"/></td>
		</c:if>
	</tr>
</s:iterator>
</table>
<br/>
<table class="mytable" cellpadding="0" cellspacing="0">
	<tr><th colspan="2">联系人信息</th></tr>
	<tr style="font-size: 14px; font-weight: bolder"><td class="left">联系人</td><td>联系电话</td></tr>
	<tr><td class="left">${vo.parentOrders[0].linkname}</td><td>${vo.parentOrders[0].telphone}</td></tr>
</table>
<s:if test="vo.itinerary!=null">
<br/>
	<table class="mytable" cellpadding="0" cellspacing="0">
	<tr><th colspan="5">行程单配送信息</th></tr>
	<tr style="font-size: 14px; font-weight: bolder">
	<td class="left">联系人</td><td>邮编</td><td>寄件地址</td><td>电话</td><td>状态</td></tr>
	<tr>
		<td class="left">${vo.itinerary.name}</td>
		<td>${vo.itinerary.zip}</td>
		<td>
			<s:if test="vo.itinerary.province==vo.itinerary.city">
				${vo.itinerary.city}
			</s:if>
			<s:else>
				${vo.itinerary.province}${vo.itinerary.city}
			</s:else>${vo.itinerary.address}
		</td>
		<td>${vo.itinerary.phone }</td>
		<td>
			<os:travelState state="${vo.itinerary.status}"/>
		</td>
	</tr>
</table>
</s:if>
    </td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
</html>